using Godot;
using Godot.Collections;
using System;

public partial class StateMachine : Node
{
	[Signal]
	public delegate void transitionedEventHandler();

	private int _current_state;
	public int current_state
	{
		get { return _current_state;}
		set{
			_player.StateChange(_current_state, value);
			_current_state = value;
		}
	}
	private Characters _player;
    public override void _Ready()
    {
        _player = GetParent<Characters>();

    }

    public override void _Process(double delta)
	{
		var next = _player.GetNextState(current_state);
		if((int)next == current_state)
		{}
		current_state = (int)next;
		_player.tickProcess(delta);
	}
    

}
